Fix: do not need storage management db#8515
Open
fstagni wants to merge 3 commits intoDIRACGrid:integrationfrom
Open
Fix: do not need storage management db#8515fstagni wants to merge 3 commits intoDIRACGrid:integrationfrom
fstagni wants to merge 3 commits intoDIRACGrid:integrationfrom
Conversation
01377d7 to
4c02ebf
Compare
4c02ebf to
456f456
Compare
456f456 to
c4fa3bd
Compare
aldbr
requested changes
Apr 14, 2026
| return result | ||
| self.storageManagementDB = result["Value"]() | ||
| except RuntimeError: | ||
| pass |
Contributor
There was a problem hiding this comment.
Why pass and not a warning log?
Based on #8511 (comment)
| return result | ||
| self.storageManagementDB = result["Value"]() | ||
| except RuntimeError: | ||
| pass |
| return result | ||
| self.storageManagementDB = result["Value"]() | ||
| except RuntimeError: | ||
| pass |
| return S_ERROR(f"Can't connect to DB: {excp!r}") | ||
| cls.storageManagementDB = result["Value"]() | ||
| except RuntimeError: | ||
| cls.storageManagementDB = None |
| ) | ||
| if not result["OK"]: | ||
| return result | ||
| storagemanagementdb = result["Value"]() |
Contributor
There was a problem hiding this comment.
What does happen here if an exception is raised?
| mocker.patch("DIRAC.WorkloadManagementSystem.Agent.JobCleaningAgent.JobDB.__init__", side_effect=mockNone) | ||
| mocker.patch( | ||
| "DIRAC.WorkloadManagementSystem.Agent.JobCleaningAgent.SandboxMetadataDB.__init__", side_effect=mockNone | ||
| "DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.ObjectLoader.loadObject", |
Contributor
There was a problem hiding this comment.
Are you patching the right module here? Shouldn't it be JobCleaningAgent?
| return {"OK": True, "Value": lambda: mocks[class_name]} | ||
|
|
||
| mocker.patch( | ||
| "DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.ObjectLoader.loadObject", |
| @classmethod | ||
| def initializeHandler(cls, serviceInfoDict): | ||
| """Initialization of DB objects and OptimizationMind""" | ||
| try: |
Contributor
There was a problem hiding this comment.
Why do you remove the try/except here? Don't you want to return S_ERROR?
|
|
||
| except RuntimeError as excp: | ||
| return S_ERROR(f"Can't connect to DB: {excp!r}") | ||
| cls.storageManagementDB = result["Value"]() |
Contributor
There was a problem hiding this comment.
No more parentLogger here. Is that expected?
Suggested change
| cls.storageManagementDB = result["Value"]() | |
| cls.storageManagementDB = result["Value"](parentLogger=cls.log) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGINRELEASENOTES
*WMS
FIX: Do not require StorageManagementDB to be there
ENDRELEASENOTES